home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / reloc.act < prev    next >
Text File  |  1995-04-22  |  2KB  |  86 lines

  1. MODULE ;RELOCATE.ACT 
  2.  
  3. ;Run-time Relocator Code. 
  4. ;For use with RELGEN.ACT 
  5. ;COPYRIGHT 1984, JS DeMar 
  6. ;Rev. 1.1, March 20,1984 
  7. ;--------------------------------- 
  8.  
  9. SET 14=$6000 
  10. SET $0491=$6000 
  11. ;--------------------------------- 
  12. ;The beginning of the relocator 
  13. ;table and code should be higher 
  14. ;than the expected end of the final 
  15. ;relocated program. But, there must 
  16. ;be enough space left for the table 
  17. ;and the relocator code itself! 
  18. ;--------------------------------- 
  19.  
  20.  
  21. ;--------------------------------- 
  22. ;Read the ".GEN" file above here. 
  23. ;--------------------------------- 
  24. ;Compile this after reading in the 
  25. ;".GEN" file above. Then append the 
  26. ;".REL" file to this code using the 
  27. ;DOS COPY command with "/A". 
  28. ;--------------------------------- 
  29.  
  30. PROC Error(BYTE err)[$6C$A] 
  31.  
  32. PROC Break=*() 
  33. [$BA$8E$4C1$80A0$98$4C Error] 
  34.  
  35. PROC ChkErr=*(BYTE r,b,eC)[$1610$88C0$8F0 
  36. $98$80C0$11F0 
  37. $4C Error$8A$4A4A$4A4A$98AA$9D EOF$60] 
  38.  
  39. PROC Break1=*(BYTE err) 
  40. [$1A2$1186$48$20 Break$68$A8$60] 
  41.  
  42. CHAR FUNC GetD=*(BYTE d)[$7A2] 
  43. PROC CCIO=*() 
  44. [$A486$A0A$A0A$AA$A4A5$9D$342$A9$0$9D$348$9D$349 
  45. $98$20$E456$A085$4C ChkErr] 
  46.  
  47. ;--------------------------------- 
  48.  
  49. PROC BootIt=*() 
  50. ;--------------------------------- 
  51.  
  52. PROC Relocate() 
  53.  
  54. BYTE offset,memlohi=$02E8,x 
  55. CARD memlo=$02E7,i,j,top,entry 
  56. BYTE ARRAY newplace 
  57.  
  58. newplace=memlo 
  59. newplace==&$FF00 
  60. offset=memlohi 
  61. i=memlo&$00FF 
  62. IF i#0 THEN 
  63.   newplace==+$0100 
  64.   offset==+1 
  65. FI 
  66. FOR i=1 TO 6  
  67. DO 
  68.   x=GetD(1) 
  69. OD 
  70.  
  71. j=0 
  72. FOR i=start TO finish+7 
  73. DO 
  74.   x=GetD(1) 
  75.   newplace(j)=x 
  76.   j==+1 
  77. OD 
  78.  
  79. FOR i=0 TO hits-1 
  80. DO 
  81.   entry=otable(i)  
  82.   newplace(entry)==+offset 
  83. OD 
  84. runaddr==+newplace 
  85. [$6C runaddr] 
  86.